package com.kyh.controller.api.sys;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.kyh.service.sys.DictService;
import com.kyh.util.CheckUtil;
import com.kyh.vo.R;

@Controller
@RequestMapping("/api/inter/dict")
public class ApiInterDictController {

	@Autowired
	private DictService dictService;
	
	@RequestMapping("/tree")
    @ResponseBody
	public R tree(Model model, HttpServletRequest request, HttpServletResponse response,
			String dictKey
			){
		
		if (!CheckUtil.notNull(dictKey)) {
			return R.error("关键字不能为空");
		}
		
		return dictService.tree(dictKey);
	}
}